# Please install OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

client = OpenAI(api_key="sk-1f2a103b336d401eae868c0941e07cac", base_url="https://api.deepseek.com")

response = client.chat.completions.create(
    model="deepseek-reasoner",
    messages=[
        {"role": "system", "content": "你是一个全能助手"},
        {"role": "user", "content": "美国的国会在哪里"},
    ],
    stream=True
)
print('思考：')
for s in response:
  content = s.choices[0].delta.reasoning_content
  if content is not None:
    print(content, end="")
print('答案：')
for s in response:
  content = s.choices[0].delta.content
  if content is not None:
    print(content, end="")
# print("思考中"+response.choices[0].message.reasoning_content)
# print("答案："+response.choices[0].message.content)